<template>

<div lang="en">
	<div class="first">
    <h1 style="text-align: center;box-shadow: 5px 5px 5px #888888; ">文章内容</h1>
		
	</div>
    <hr>
	<h3 class="NewsBody">

		{{ newsbody}}
		
	</h3>
</div>

	
</template>

<script type="text/javascript">
	export default{
		data(){
			return{
				newsbody:'',
				id:this.$route.params.id

			}
		},
		created(){
			this.getNewsBody()
		},
		methods:{

			getNewsBody(){
				this.$http.get('http://jsonplaceholder.typicode.com/posts/'+this.id).then(
				result=>{
					if(result.ok==true){
						this.newsbody=result.body.body
					}else{
						Toast("请求失败")
					}

				}
				)

			}
		}


	}
	
</script>

<style type="text/css" scoped>
	.NewsBody{
		font-size:20px;
		text-indent:30px;
		text-align: left;
		font-family:'微软雅黑';
		line-height:30px;
		word-spacing:3px;
		-webkit-hyphens:auto;
		word-break: break-all;
		word-wrap: break-word;

	}
	h1{
		width: 90%;
		border:1px solid black;
		
	}
	div .first{
		display: flex;
		justify-content: center;
	}

</style>